﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using TournamentDatabase.Database;

namespace TournamentDatabase.Objects
{
	public class CompetesIn : Competitor
	{
		int m_placing;

		public int Placing
		{
			get { return m_placing; }
			set { m_placing = value; }
		}
		string m_details;

		public string Details
		{
			get { return m_details; }
			set { m_details = value; }
		}

		public CompetesIn() : this(0, 0, "") { }
		public CompetesIn(int mid, int placing, string details)
		{
			m_mid = mid;
			m_placing = placing;
			m_details = details;
		}
		public CompetesIn(OracleDataReader odr) : base(odr)
		{
			Placing = int.Parse(odr["Placing"]);
			Details = odr["Details"].ToString();
			//MemberID = int.Parse(odr["mid"]);
			//c.Gender = Enum.Parse(typeof(Gender), odr["gender"].ToString());
			//c.TournamentID = (int)odr["tid"];
			//c.minBirthDate = (DateTime)odr["minBirthDate"];
			//c.maxBirthDate = (DateTime)odr["maxBirthDate"];
			//c.type = odr["type"].ToString();
		}

        public static List<CompetesIn> ParseCompetesIn(OracleDataReader odr)
        {
            List<CompetesIn> list = new List<CompetesIn>();
            while (odr.Read())
            {
				list.Add(new CompetesIn(odr));
            }
            return list;
        } 
	}
}
